__________________________________________________________________________________________________
class Solution {
    public int calculateTime(String keyboard, String word) {
        int pos = 0;
        int ans = 0;
        for(char c : word.toCharArray()){
            int p = keyboard.indexOf(c);
            ans += Math.abs(p - pos);
            pos = p;
        }
        return ans;
    }
}	
__________________________________________________________________________________________________

__________________________________________________________________________________________________
